﻿@model List<ISSMoviePlex.DAL.Models.Ticket>

@{
    ViewBag.Title = "Buy";
    double ticketPrice = Model[0].Schedule.TicketPrice;
    int noOfTicket = Model.Count;
    double discount = ViewBag.Discount;
    double total = ticketPrice * noOfTicket;
    double payable = total * (1 - discount / 100);        
    string ticketID = Model[0].TicketId.ToString();
    string seatNo = Model[0].SeatNo;
    for (int i = 1; i < noOfTicket; i++)
    {
        ticketID += ", " + Model[i].TicketId;
        seatNo += ", " + Model[i].SeatNo;
    }
}

<h2>Ticket Booking Details</h2>

<fieldset>
    <legend>Details</legend>
    <br />

    <div class="display-label">
         Movie:
    </div>
    <div class="display-field">
        @Model[0].Schedule.Movie.MovieName
    </div>
    <br />

    <div class="display-label">
         Room:
    </div>
    <div class="display-field">
        @Model[0].Schedule.RoomId
    </div>
    <br />

    <div class="display-label">
         Movie Show Time:
    </div>
    <div class="display-field">
        @Model[0].Schedule.ShowTime
    </div>
    <br />

    <div class="display-label">
         Ticket Price:
    </div>
    <div class="display-field">
        $@ticketPrice
    </div>
    <br />

    <div class="display-label">
         Number of ticket:
    </div>
    <div class="display-field">
        @noOfTicket
    </div>
    <br />

    <div class="display-label">
         Ticket ID:
    </div>
    <div class="display-field">
        @ticketID
    </div>
    <br />

    <div class="display-label">
         Seat number:
    </div>
    <div class="display-field">
        @seatNo
    </div>
    <br />

    <div class="display-label">
         Booking Date:
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model[0].BookingDate)
    </div>
    <br />

    <div class="display-label">
         Total Amount:
    </div>
    <div class="display-field">
        $@total
    </div>
    <br />

    <div class="display-label">
         Discount:
    </div>
    <div class="display-field">
        @discount%
    </div>
    <br />

    <div class="display-label">
         Payable Amount:
    </div>
    <div class="display-field">
        $@payable
    </div>
    <br />
</fieldset>
